package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RegistrationMapper;
import com.ruoyi.system.domain.Registration;
import com.ruoyi.system.service.IRegistrationService;

/**
 * 报名试听Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-30
 */
@Service
public class RegistrationServiceImpl implements IRegistrationService 
{
    @Autowired
    private RegistrationMapper registrationMapper;

    /**
     * 查询报名试听
     * 
     * @param id 报名试听主键
     * @return 报名试听
     */
    @Override
    public Registration selectRegistrationById(Long id)
    {
        return registrationMapper.selectRegistrationById(id);
    }

    /**
     * 查询报名试听列表
     * 
     * @param registration 报名试听
     * @return 报名试听
     */
    @Override
    public List<Registration> selectRegistrationList(Registration registration)
    {
        return registrationMapper.selectRegistrationList(registration);
    }

    /**
     * 新增报名试听
     * 
     * @param registration 报名试听
     * @return 结果
     */
    @Override
    public int insertRegistration(Registration registration)
    {
        registration.setCreateTime(DateUtils.getNowDate());
        return registrationMapper.insertRegistration(registration);
    }

    /**
     * 修改报名试听
     * 
     * @param registration 报名试听
     * @return 结果
     */
    @Override
    public int updateRegistration(Registration registration)
    {
        registration.setUpdateTime(DateUtils.getNowDate());
        return registrationMapper.updateRegistration(registration);
    }

    /**
     * 批量删除报名试听
     * 
     * @param ids 需要删除的报名试听主键
     * @return 结果
     */
    @Override
    public int deleteRegistrationByIds(Long[] ids)
    {
        return registrationMapper.deleteRegistrationByIds(ids);
    }

    /**
     * 删除报名试听信息
     * 
     * @param id 报名试听主键
     * @return 结果
     */
    @Override
    public int deleteRegistrationById(Long id)
    {
        return registrationMapper.deleteRegistrationById(id);
    }
}
